import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

export default defineConfig({
    plugins: [vue()],
    resolve: {
        alias: {
            '@': path.resolve(__dirname, 'src')
        }
    },
    server: {
        proxy: {
            '/images': {
                target: 'http://45.205.29.30:9001',
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/api/, '/images')
            },
            '/css': {
                target: 'http://45.205.29.30:9001',
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/api/, '/css')
            }
        }
    }
})
